package xq.gwt.ui.crud;

import java.util.HashMap;
import xq.gwt.mvc.model.ListItem;
import xq.gwt.mvc.model.PersistableEntityModel;

import com.google.gwt.user.client.rpc.AsyncCallback;

public interface PersistanceServiceAsync {

	void deleteEntity(PersistableEntityModel entity,AsyncCallback<Boolean> callback);
	void fetchAll(PersistableEntityModel entity,AsyncCallback<PersistableEntityModel[]> callback);
	void persistEntity(PersistableEntityModel entity,AsyncCallback<PersistableEntityModel> callback);
	@Deprecated
	void fetch(PersistableEntityModel entity, FilterModel filter,	AsyncCallback<FetchedEntities> callback);
	void fetchEntity(PersistableEntityModel entity,	AsyncCallback<PersistableEntityModel> callback);
	@Deprecated
	void fetch(PersistableEntityModel entity, FilterModel filter, Integer offset, Integer maxRowCount,
			AsyncCallback<FetchedEntities> callback);
	void fetch(PersistableEntityModel entity, FilterModel filter,OrderByModel[] orderBy, Integer offset, Integer maxRowCount,
			AsyncCallback<FetchedEntities> callback);
	@Deprecated
	void fetch(PersistableEntityModel entity, FilterModel filter,
			OrderByModel[] orderBy, AsyncCallback<FetchedEntities> callback);
	void deleteAll(PersistableEntityModel entity, AsyncCallback<Void> callback);
	void fetchEntityListItems(PersistableEntityModel entity,
			AsyncCallback<HashMap<String, ListItem[]>> callback);

}
